#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#     Filename @  mahjong_desk.py
#       Author @  Huoty
#  Create date @  2015-01-07 09:48:53
#  Description @  
# *************************************************************

import gtk

class VHA(gtk.Window):
    def __init__(self):
        super(VHA,self).__init__()
        self.set_size_request(500,300)
        self.set_position(gtk.WIN_POS_CENTER)
        self.set_title('模拟一个麻将桌的布局')
 
        self._init_child()
        self.connect('destroy',gtk.main_quit)
        self.show_all()
 
    def _init_child(self):
 
        vbox=gtk.VBox(False,3)
 
        l1=gtk.Label('角')
        l1.set_size_request(20,20)
        l2=gtk.Label('角')
        l2.set_size_request(20,20)
        l3=gtk.Label('角')
        l3.set_size_request(20,20)
        l4=gtk.Label('角')
        l4.set_size_request(20,20)
 
        l5=gtk.Label('这个放在中间')
        calign=gtk.Alignment(0.3,0,0,0.3)
        calign.add(l5)
 
        b1=gtk.Button('北')
        b2=gtk.Button('西')
        b3=gtk.Button('东')
        b4=gtk.Button('南')
 
        hbox1=gtk.HBox(False,3)
        hbox1.pack_start(l1,False,False)
        hbox1.pack_start(b1)
        hbox1.pack_start(l2,False,False)
        vbox.pack_start(hbox1,False,False)
 
        hbox2=gtk.HBox(False,3)
        hbox2.pack_start(b2,False,False)
        hbox2.pack_start(calign)
        hbox2.pack_start(b3,False,False)
        vbox.pack_start(hbox2)
 
        hbox3=gtk.HBox(False,3)
        hbox3.pack_start(l3,False,False)
        hbox3.pack_start(b4)
        hbox3.pack_start(l4,False,False)
        vbox.pack_start(hbox3,False,False)
 
        self.add(vbox)
 
if __name__=='__main__':
    VHA()
    gtk.main()

# Script starts from here


